/*    */ package com.wy17113.controller.utils;
/*    */ 
/*    */ import java.sql.Connection;
/*    */ import java.sql.DriverManager;
/*    */ import java.sql.SQLException;
/*    */ 
/*    */ public class DBConnection
/*    */ {
/* 14 */   private static Connection conn = null;
/*    */   public static String strDBName;
/*    */ 
/*    */   public void LoadDBName(String name)
/*    */   {
/* 18 */     strDBName = name;
/*    */   }
/*    */ 
/*    */   public static String GetDBName()
/*    */   {
/* 23 */     return strDBName;
/*    */   }
/*    */ 
/*    */   public static Connection getConnection() {
/*    */     try {
/* 28 */       Class.forName(DBConfigHelper.getDriverClass());
/* 29 */       conn = DriverManager.getConnection(DBConfigHelper.getUrl(), DBConfigHelper.getUserName(), DBConfigHelper.getPassword());
/*    */     } catch (ClassNotFoundException e) {
/* 31 */       e.printStackTrace();
/*    */     } catch (SQLException e) {
/* 33 */       e.printStackTrace();
/*    */     }
/* 35 */     return conn;
/*    */   }
/*    */ }